package com.weitu.risk.service.impl;

import com.weitu.risk.entity.MatrixPossibility;
import com.weitu.risk.mapper.MatrixPossibilityMapper;
import com.weitu.risk.service.MatrixPossibilityService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class MatrixPossibilityServiceImpl implements MatrixPossibilityService{
    @Autowired
    private MatrixPossibilityMapper matrixPossibilityMapper;

    @Override
    public List<MatrixPossibility> queryListByParam(Map<String, Object> map) {
        return this.matrixPossibilityMapper.queryListByParam(map);
    }

    @Override
    public boolean addPossibility(Map<String,Object> map) {
        int flag = this.matrixPossibilityMapper.insertPossibility(map);
        if(flag<1){
            return false;
        }
        return true;
    }

    @Override
    public boolean editPossibility(Map<String,Object> map) {
        int flag = this.matrixPossibilityMapper.updatePossibility(map);
        if(flag<1){
            return false;
        }
        return true;
    }

    @Override
    public boolean deletePossibility(@Param("id") String id) {
        int flag = this.matrixPossibilityMapper.deletePossibility(id);
        if(flag<1){
            return false;
        }
        return true;
    }

    @Override
    public MatrixPossibility queryPossbilityById(String id) {
        return this.matrixPossibilityMapper.queryPossbilityById(id);
    }
}